home *** CD-ROM | disk | FTP | other *** search
- * @demtable demonstrates the table command.
- * table: transforms a grey value image using a look-up table.
- *
- * The grey value g from the input image (first parameter) is used
- * as table address, the content found there becomes the grey value
- * h in the output image (second parameter).
- shad a
- copy a b 1 1 0 1 1 0
- *transposed
- * Several tables can be generated (third parameter, t):
- * t=0: (h/255)=(g/255)**(j/k);
- table a d 0 1 2
- * j/k=1/2, power, square root
- add b d
- th d d 1 127
- table a d 0 2 1
- * j/k=2/1, power, square
- add b d
- th d d 1 127
- * t=0: (h/255)=g**(j/k), for j/k<0 different scaling: g instead of g/255;
- table a d 0 -1 1
- * j/k=-1/1, neg.power
- add b d
- th d d 1 127
- * t=2: (h/255)=(k/g)**j;
- table a d 2 1 1
- * 255/g, reciprocal
- add b d
- th d d 1 127
- * t=1: (h/255)=(j/k)**((g/255)-1); j=0 -> j/k=e;
- table a d 1 10 1
- * exponential, base 10
- add b d
- th d d 1 127
- table a d 1 0 1
- * exponential, base e
- add b d
- th d d 1 127
- * t=-1: (h/255)-1=log(g/255)/log(j/k);
- table a d -1 10 1 1
- * logarithm, base 10
- add b d
- th d d 1 127
- table a d -1 0 1 1
- * logarithm, base e
- add b d
- th d d 1 127
- * t=3: pi2 (h-127-j)/127=atan((k/100) pi2 (g-127)/128 - tan(pi2 j/127)); pi2=pi/2;
- * t=3: h =atan((k/100) g - (k/100) gj );
- table a d 3 0 100 1
- * arctangent S-curve
- add b d
- th d d 1 127
- * t=-3: pi2 (h-127)/128=(tan(pi2 (g-127-j)/127)+tan(pi2 j/127)) /(k/100); pi2=pi/2;
- * t=-3: h =(tan (g -j) + (k/100) gj ) /(k/100);
- table a d -3 0 100 1
- * tangent inverse S-curve
- add b d
- th d d 1 127
-